59
60
{ oVerbose, "verbose", 0, N_("verbose") },
60
61
{ oQuiet, "quiet", 0, N_("quiet") },
61
62
{ oHex, "hex", 0, N_("print data out hex encoded") },
63
{ oDecode,"decode", 0, N_("decode received data lines") },
62
64
{ oRawSocket, "raw-socket", 2, N_("|NAME|connect to Assuan socket NAME")},
63
65
{ oExec, "exec", 0, N_("run the Assuan server given on the command line")},
64
66
{ oNoExtConnect, "no-ext-connect",
633
fwrite (line, linelen, 1, stdout);
637
else if (linelen >= 1
639
&& (line[1] == '\0' || line[1] == ' '))
641
fwrite (line, linelen, 1, stdout);
644
else if (linelen >= 2
645
&& line[0] == 'O' && line[1] == 'K'
646
&& (line[2] == '\0' || line[2] == ' '))
648
fwrite (line, linelen, 1, stdout);
652
else if (linelen >= 3
653
&& line[0] == 'E' && line[1] == 'R' && line[2] == 'R'
654
&& (line[3] == '\0' || line[3] == ' '))
656
fwrite (line, linelen, 1, stdout);
660
else if (linelen >= 7
661
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
662
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
664
&& (line[7] == '\0' || line[7] == ' '))
666
fwrite (line, linelen, 1, stdout);
668
if (!handle_inquire (ctx, line))
669
assuan_write_line (ctx, "CANCEL");
671
else if (linelen >= 3
672
&& line[0] == 'E' && line[1] == 'N' && line[2] == 'D'
673
&& (line[3] == '\0' || line[3] == ' '))
675
fwrite (line, linelen, 1, stdout);
677
/* Received from server, thus more responses are expected. */
680
return gpg_error (GPG_ERR_ASS_INV_RESPONSE);
648
const unsigned char *s;
652
for (j=2, s=(unsigned char*)line+2; j < linelen; j++, s++ )
656
fputs ("D ", stdout);
659
if (*s == '%' && j+2 < linelen)
671
need_lf = (c != '\n');
675
fwrite (line, linelen, 1, stdout);
689
&& (line[1] == '\0' || line[1] == ' '))
691
fwrite (line, linelen, 1, stdout);
694
else if (linelen >= 2
695
&& line[0] == 'O' && line[1] == 'K'
696
&& (line[2] == '\0' || line[2] == ' '))
698
fwrite (line, linelen, 1, stdout);
702
else if (linelen >= 3
703
&& line[0] == 'E' && line[1] == 'R' && line[2] == 'R'
704
&& (line[3] == '\0' || line[3] == ' '))
706
fwrite (line, linelen, 1, stdout);
710
else if (linelen >= 7
711
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
712
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
714
&& (line[7] == '\0' || line[7] == ' '))
716
fwrite (line, linelen, 1, stdout);
718
if (!handle_inquire (ctx, line))
719
assuan_write_line (ctx, "CANCEL");
721
else if (linelen >= 3
722
&& line[0] == 'E' && line[1] == 'N' && line[2] == 'D'
723
&& (line[3] == '\0' || line[3] == ' '))
725
fwrite (line, linelen, 1, stdout);
727
/* Received from server, thus more responses are expected. */
730
return gpg_error (GPG_ERR_ASS_INV_RESPONSE);