File: cat_authproto.c

package info (click to toggle)
xsecurelock 1.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,164 kB
  • sloc: ansic: 4,522; sh: 1,645; makefile: 263
file content (18 lines) | stat: -rw-r--r-- 331 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdlib.h>

#include "../helpers/authproto.h"

int main() {
  int eof_permitted = 0;
  for (;;) {
    char type;
    char *message;
    type = ReadPacket(0, &message, eof_permitted);
    if (type == 0) {
      return 0;
    }
    WritePacket(1, type, message);
    free(message);
    eof_permitted = !eof_permitted;
  }
}