Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-25 Thread Junio C Hamano
Bernhard Reiter writes: > Yeah, but I still need to wrap the non-tunneled operation in #ifdefs in > case we don't USE_CURL_FOR_IMAP_SEND in which case we fall back to the > handwritten IMAP code, don't I? We do not mind multiple implementations of the same helper function that are guarded with #

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-25 Thread Bernhard Reiter
Am 2014-08-19 um 19:51 schrieb Junio C Hamano: > This looks strange and stands out like a sore thumb. Do any of our > other sources do this kind of macro tweaking inside C source before > including git-compat-util.h (or its equivalent like cache.h)? I haven't checked, but I agree that it's desira

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-19 Thread Junio C Hamano
Bernhard Reiter writes: > Use libcurl's high-level API functions to implement git-imap-send > instead of the previous low-level OpenSSL-based functions. > > Since version 7.30.0, libcurl's API has been able to communicate with > IMAP servers. Using those high-level functions instead of the curren

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-19 Thread Junio C Hamano
Bernhard Reiter writes: > Am 2014-08-17 um 20:42 schrieb Jeff King: >> [...] >> I'm not sure I understand this comment. Even if SSL is not in use, wouldn't we be passing a regular pipe to curl, which would break? >>> >>> Yeah, we can't do that, and thus would have to keep the handwritt

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-19 Thread Bernhard Reiter
Am 2014-08-17 um 20:42 schrieb Jeff King: > [...] > >>> I'm not sure I understand this comment. Even if SSL is not in use, >>> wouldn't we be passing a regular pipe to curl, which would break? >> >> Yeah, we can't do that, and thus would have to keep the handwritten IMAP >> implementation just for

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-17 Thread Jeff King
On Sun, Aug 17, 2014 at 02:56:10PM +0200, Bernhard Reiter wrote: > > I'm not sure if that would cause problems on Windows, > > though. > > Apparently socketpair is not available there. Googling "socketpair > windows" yields, among a lot of other useful resources, the following > relatively active

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-17 Thread Bernhard Reiter
Am 2014-08-17 um 10:30 schrieb Jeff King: > On Tue, Aug 12, 2014 at 06:59:17PM -0700, Jonathan Nieder wrote: > >>> + curl_socket_t sockfd = tunnel.out; // what about tunnel.in ? >> >> Hmm. curl expects to get a socket it can send(), recv(), setsockopt(), >> etc on instead of a pair of f

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-17 Thread Jeff King
On Tue, Aug 12, 2014 at 06:59:17PM -0700, Jonathan Nieder wrote: > > + curl_socket_t sockfd = tunnel.out; // what about tunnel.in ? > > Hmm. curl expects to get a socket it can send(), recv(), setsockopt(), > etc on instead of a pair of fds to read() and write(). I wonder if we could

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-14 Thread Bernhard Reiter
Use libcurl's high-level API functions to implement git-imap-send instead of the previous low-level OpenSSL-based functions. Since version 7.30.0, libcurl's API has been able to communicate with IMAP servers. Using those high-level functions instead of the current ones would reduce imap-send.c by

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-12 Thread Jonathan Nieder
Bernhard Reiter wrote: > Use libcurl's high-level API functions to implement git-imap-send > instead of the previous low-level OpenSSL-based functions. Wow! This sounds lovely. Thanks for working on this. [...] > Since version 7.30.0, libcurl's API has been able to communicate with > IMAP serv

[PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-12 Thread Bernhard Reiter
Use libcurl's high-level API functions to implement git-imap-send instead of the previous low-level OpenSSL-based functions. Signed-off-by: Bernhard Reiter --- Since version 7.30.0, libcurl's API has been able to communicate with IMAP servers. Using those high-level functions instead of the curr