- char type = 'o';
- if (has_sha1_file(sha1))
- return 0;
- write(fd_out, &type, 1);
- write(fd_out, sha1, 20);
- if (read(fd_in, &remote, 1) < 1)
- return -1;
+
+ if (conn_buf_posn) {
+ remote = conn_buf[0];
+ memmove(conn_buf, conn_buf + 1, --conn_buf_posn);
+ } else {
+ if (read(fd_in, &remote, 1) < 1)
+ return -1;
+ }
+ //fprintf(stderr, "Got %d\n", remote);