diff --git a/uppsrc/Core/MIME.cpp b/uppsrc/Core/MIME.cpp index 8ebcacfb5..acc8aab39 100644 --- a/uppsrc/Core/MIME.cpp +++ b/uppsrc/Core/MIME.cpp @@ -9,6 +9,7 @@ static Tuple2 sEXT_MIME[] = { { "eml", "message/rfc822" }, { "tiff", "image/tiff" }, { "xls", "application/vnd.ms-excel" }, + { "csv", "text/csv" }, { "323", "text/h323" }, { "acx", "application/internet-property-stream" }, @@ -228,7 +229,10 @@ const Index& GetMIMETypes() { String FileExtToMIME(const String& ext) { - int q = sEXT().Find(ToLower(ext)); + String h = ToLower(ext); + if(*h == '.') + h = h.Mid(1); + int q = sEXT().Find(h); return q >= 0 ? sMIME()[q] : "application/octet-stream"; } diff --git a/uppsrc/Core/SMTP/src.tpp/SMTP$en-us.tpp b/uppsrc/Core/SMTP/src.tpp/SMTP$en-us.tpp index a3ed47f0d..06d85e4d6 100644 --- a/uppsrc/Core/SMTP/src.tpp/SMTP$en-us.tpp +++ b/uppsrc/Core/SMTP/src.tpp/SMTP$en-us.tpp @@ -130,9 +130,19 @@ ring][@(0.0.255) `&]_[*@3 txt])&] [s2; Restarts Smtp for sending of next email (resets all addresses, bodies, attachments, subject).&] [s3; &] +[s4;%- &] +[s5;:Smtp`:`:GetMessage`(`):%- [_^String^ String]_[* GetMessage]()&] +[s2; Returns the message in RFC`-822 format, without sending it.&] +[s3;%- &] +[s4;%- &] +[s5;:Smtp`:`:Send`(const String`&`):%- [@(0.0.255) bool]_[* Send]([@(0.0.255) const]_[_^String^ S +tring][@(0.0.255) `&]_[*@3 message])&] +[s2; Send the raw message in RFC`-822 format.&] +[s3; &] [s4; &] [s5;:Smtp`:`:Send`(`):%- [@(0.0.255) bool]_[* Send]()&] -[s2; Sends email. Returns true on success.&] +[s2; Sends email. Returns true on success. Same as Send(GetMessage()), +except that this form is able to send attachments in chunks.&] [s3; &] [s4; &] [s5;:Smtp`:`:GetError`(`)const:%- [_^String^ String]_[* GetError]()_[@(0.0.255) const]&] diff --git a/uppsrc/Core/Vcont.h b/uppsrc/Core/Vcont.h index c53abd58f..f52353301 100644 --- a/uppsrc/Core/Vcont.h +++ b/uppsrc/Core/Vcont.h @@ -116,10 +116,12 @@ public: // << ", " << typeid(T).name()); //TODO remove Free(); return; // Constraints: -#ifndef CPP_11 - T t(pick(*vector)); // T must have transfer constructor (also GCC 4.0 bug workaround) -#endif +#ifdef CPP_11 AssertMoveable((T *)0); // T must be moveable +#else + T t(pick(*vector)); // T must have transfer constructor (also GCC 4.0 bug workaround) + AssertMoveable(&t); // T must be moveable +#endif } // Pick assignment & copy. Picked source can only do Clear(), ~Vector(), operator=, operator <<= diff --git a/uppsrc/Core/src.tpp/Inet$en-us.tpp b/uppsrc/Core/src.tpp/Inet$en-us.tpp index 029719ad9..4d7109305 100644 --- a/uppsrc/Core/src.tpp/Inet$en-us.tpp +++ b/uppsrc/Core/src.tpp/Inet$en-us.tpp @@ -95,12 +95,14 @@ pes]()&] [s4; &] [s5;:FileExtToMIME`(const String`&`): [_^String^ String]_[* FileExtToMIME]([@(0.0.255) cons t]_[_^String^ String][@(0.0.255) `&]_[*@3 ext])&] -[s2;%% Converts the file extension to MIME type.&] +[s2;%% Converts the file extension to MIME type. [%-*@3 ext] can, but +does not need to start with `'.`' (it is removed before searching).&] [s3;%% &] [s4; &] [s5;:MIMEToFileExt`(const String`&`): [_^String^ String]_[* MIMEToFileExt]([@(0.0.255) cons t]_[_^String^ String][@(0.0.255) `&]_[*@3 mime])&] -[s2;%% Converts the MIME type to the most likely file extension.&] +[s2;%% Converts the MIME type to the most likely file extension (without +`'.`' at begin).&] [s3;%% &] [s4; &] [s5;:HttpResponse`(TcpSocket`&`,bool`,int`,const char`*`,const char`*`,const String`&`,const char`*`,bool`): [@(0.0.255) b