- in the for-loop, search first start as initializer, this saves one unneccesary memcmp
- cr/lf detection: we need to do that _before_ the first mime content is evaluated.
Performance: use memchr to find the next '-' and then call memcmp to check whether this is a boundary
- we fast forward to the next '-' since every mime boundary starts with '-'
- from a '-' we check thorough whether at this point we can find the searched boundary
Mime-parser rework: parse the mime headers of the current container so we can guess the size of the content to jump accross; binary/ascii is used to switch the search algorithm for the next boundary.
- the old mime parser version skipped empty containers; we do this by hand
- for some reason the numbers addressing the mimeparts grow different, maybe mixed use of old/new may cause confusion...
to be able to test the mimeparser in an insulated binary, here we have a test, that reads a given file into memory, and parses it using the mime parser.
More hickups found due to the mimetester; pre push.
- the_mime_parser (): we need to know where parse_MimeHeaders() finds the end of the headers.
- the_mime_parser (): don't move the pointer around just to count up to the end-pointer. this can be done by pointer substraction.
- parse_MimeHeaders (): move the parameter so our caller gets to know what we read
- parse_MimeHeaders (): if (ptr >= content_end) after reading is probably a bug (also there in stable..), that makes us fail to read the last line, if. move it to the end of the pointer.
- don't call strchr twice; remember & evaluate the first result
- stripping the disposition-header can be done right where we found it.
- move the cluster of buffers into a struct compatible to the CKEY macro
- add the interesting other evaluated flags & numbers to that struct
- move finding & parsing of the 'interesting headers' into its own function.
by all this we hope to get informations about the mimepart before we have to search for its end
- remove strlen from the for loop abort condition
- move string around _once_
- return the length of the string we operated on, since we know it after the operation anyways.
avoid decoding mime-parts unless we realy need to.
- suff... doesn't need to decode all attachments; we just need the mime headers here.
- when searching for the attachment we want to output, we also don't need the content.
- when outputing an attachment, just decode the attachment were actualy interested in.
- looping forward while moving a pointer and doing memcmp isn't fast. replace it by strstr
- \r\n can be done in a pointer dereferencing comparison.
Note: maybe we need to fallback to the memcmp way if there is binary content?
In that case we should do a little smarter and try to use contentlength-headers etc.
avoid calling GETR for the number of total/read messages
so far webcit used a call of GETR to retrieve the number of messages available in the current room for displaying the room banner.
However, GOTO already gave us this information, and GETR is only available for aides, so we got Important messages with that error when logged in as joe average.
This went under the radar for quiet a while, since the error message wasn't printed but silently ignored.
- default is 30 seconds
- Server greeting 90 seconds (DNS lookups for RBLs might be slow
- Server sending the response to the EOM sequence; here we might have background processing like virus or spam scanning that wants to finish before finaly accepting the message.
Don't send identity header if we want to do gzip compression
Propfind replies send 'Content-encoding: identity' right now, which is superseeded by the frameworks 'Content-encoding: gzip' in case of the client indicates this.
sending that headers twice has uncertain results depending on the client; while the RFC demands to evaluate the later, some fail to read our reply then.
- move defines from imap_tools.h into serv_imap.h
- switch includes in sequence
- we now have IMAP->Reply, which we write into, until IUnbuffer sends it to the client
- IReply & IReplyPrintf do now send 'Params[0].Key BAD xxxxxx\r\n' to the client; this makes the code more compact.
- IA* append stuff to the outbuffer that we want to send.
- replace rumpelstilskin handler lookup by hashlist and central register calls.
- replace if's in the sequence separating the handlers by their required pre-conditions by flags on the register call.
this should
- (hopefully) fix some troubles with evolutions imap, which wouldn't like to read enough chunks until the line ends
- speed up stuff like header fetching in huge lists, since we reduce the number of context switches here.
have flexible timouts while reading lines in our client mode connections
since some mailserver take a little longer to finish reading mails we need to wait after we send our '.\r\n'; its 90 seconds now, all other parts will wait 5s, quit will wait 1 second.
we changed the SMTP outbound connections to be nonblocking so we could abort on not reacting SMTP-Servers.
thus we need to select before writing, else the connection will fail.
don't fetch a RSS before the network frequency is elapsed
currently the RSS-Thread is run over and over; we shouldn't stress our partrers to much, so we let the network poll frequency elaps before we try to poll the rss feed again.