threads / patch / 37343

patchgit-imap-send: simplify tunnel construction

Subject: [PATCH] git-imap-send: simplify tunnel construction

## tl;dr

4 messages between Aug 13, 2014 and Aug 18, 2014. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Bernhard Reiter· Aug 13, 2014, 17:30 UTC · lore
Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
---
 imap-send.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Show changes to imap-send.c +2 −3
diff --git a/imap-send.c b/imap-send.c
index 524fbab..fb01a9c 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -961,17 +961,16 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
 	/* open connection to IMAP server */
 
 	if (srvc->tunnel) {
-		const char *argv[] = { srvc->tunnel, NULL };
 		struct child_process tunnel = {NULL};
 
 		imap_info("Starting tunnel '%s'... ", srvc->tunnel);
 
-		tunnel.argv = argv;
+		argv_array_push(&tunnel.args, srvc->tunnel);
 		tunnel.use_shell = 1;
 		tunnel.in = -1;
 		tunnel.out = -1;
 		if (start_command(&tunnel))
-			die("cannot start proxy %s", argv[0]);
+			die("cannot start proxy %s", srvc->tunnel);
 
 		imap->buf.sock.fd[0] = tunnel.out;
 		imap->buf.sock.fd[1] = tunnel.in;
Jeff King· Aug 17, 2014, 07:30 UTC · re: Bernhard Reiter · lore

Re: [PATCH] git-imap-send: simplify tunnel construction

On Wed, Aug 13, 2014 at 07:30:43PM +0200, Bernhard Reiter wrote:
> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
> ---
>  imap-send.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
Thanks, this looks obviously correct and is a good direction.
-Peff
Junio C Hamano· Aug 18, 2014, 17:00 UTC · re: Bernhard Reiter · lore

Re: [PATCH] git-imap-send: simplify tunnel construction

Bernhard Reiter <ockham@raz.or.at> writes:
> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
> ---
>  imap-send.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
Oy.  Where is the patch?
Please avoid multipart/mixed on this list.
Thanks.
Bernhard Reiter· Aug 18, 2014, 17:15 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-imap-send: simplify tunnel construction

Am 2014-08-18 um 19:00 schrieb Junio C Hamano:
Show 12 quoted lines
> Bernhard Reiter <ockham@raz.or.at> writes:
> 
>> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
>> ---
>>  imap-send.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Oy.  Where is the patch?
> 
> Please avoid multipart/mixed on this list.
> 
> Thanks.

D'oh. Sorry about that. Strangely, that's what I'm getting from a message created with git-imap-send. Maybe Thunderbird is messing it up afterwards. Anyway:

Show changes to imap-send.c +2 −3
diff --git a/imap-send.c b/imap-send.c
index 524fbab..fb01a9c 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -961,17 +961,16 @@ static struct imap_store *imap_open_store(struct
imap_server_conf *srvc)
 	/* open connection to IMAP server */

 	if (srvc->tunnel) {
-		const char *argv[] = { srvc->tunnel, NULL };
 		struct child_process tunnel = {NULL};

 		imap_info("Starting tunnel '%s'... ", srvc->tunnel);

-		tunnel.argv = argv;
+		argv_array_push(&tunnel.args, srvc->tunnel);
 		tunnel.use_shell = 1;
 		tunnel.in = -1;
 		tunnel.out = -1;
 		if (start_command(&tunnel))
-			die("cannot start proxy %s", argv[0]);
+			die("cannot start proxy %s", srvc->tunnel);

 		imap->buf.sock.fd[0] = tunnel.out;
 		imap->buf.sock.fd[1] = tunnel.in;

← back to recent threads