try {
// The client may be in a state where they have sent the sideband
// capability and are expecting a response in the sideband, but we might
// not have an UploadPack, or it might not have read any of the request.
// So, cheat and read the first line.
String line = new PacketLineIn(req.getInputStream()).readString();
UploadPack.FirstLine parsed = new UploadPack.FirstLine(line);
return (parsed.getOptions().contains(OPTION_SIDE_BAND)
|| parsed.getOptions().contains(OPTION_SIDE_BAND_64K));
} catch (IOException e) {
// Probably the connection is closed and a subsequent write will fail, but