11 #include <GSSRequest.h>
19 int main(int argc, char **argv) {
31 _setmode(_fileno(stdin), _O_BINARY);
33 int readThisRound, readTotal, readRemaining;
38 readThisRound = readTotal = 0;
41 readThisRound = _read(0, ((&len) + readTotal), 4 - readTotal);
42 readTotal += readThisRound;
45 // Reads the number of bytes indicated by the above read
46 input = new char[len + 1];
47 readTotal = readThisRound = 0;
48 while (readTotal < len)
50 readRemaining = len - readTotal;
51 readThisRound = _read( 0, &(input[readTotal]), readRemaining);
52 if (-1 == readThisRound)
55 readTotal += readThisRound;
57 // ... and null-terminate it
60 output = gss_request(input);
61 len = (int32_t )strlen(output);
63 cout.write((char *)&len, 4);
65 deallocate_reply(output);