- if (n > 0) {
- ogroup[0] = dtable[igroup[0] >> 2];
- ogroup[1] = dtable[((igroup[0] & 3) << 4) | (igroup[1] >> 4)];
- ogroup[2] = dtable[((igroup[1] & 0xF) << 2) | (igroup[2] >> 6)];
- ogroup[3] = dtable[igroup[2] & 0x3F];
-
- /* Replace characters in output stream with "=" pad
- characters if fewer than three characters were
- read from the end of the input stream. */
-
- if (n < 3) {
- ogroup[3] = '=';
- if (n < 2) {
- ogroup[2] = '=';
+ else
+ {
+ StrBufAppendPrintf(WCC->HBuf, "Set-cookie: webcit=");
+ snprintf(buf, sizeof(buf), "%d", WCC->wc_session);
+ StrBufHexescAppend(WCC->HBuf, NULL, buf);
+ StrBufHexescAppend(WCC->HBuf, NULL, "|");
+ StrBufHexescAppend(WCC->HBuf, WCC->wc_username, NULL);
+ StrBufHexescAppend(WCC->HBuf, NULL, "|");
+ StrBufHexescAppend(WCC->HBuf, WCC->wc_password, NULL);
+ StrBufHexescAppend(WCC->HBuf, NULL, "|");
+ StrBufHexescAppend(WCC->HBuf, WCC->CurRoom.name, NULL);
+ StrBufHexescAppend(WCC->HBuf, NULL, "|");
+ StrBufHexescAppend(WCC->HBuf, NULL, get_selected_language());
+ StrBufHexescAppend(WCC->HBuf, NULL, "|");
+
+ if (server_cookie != NULL) {
+ StrBufAppendPrintf(WCC->HBuf,
+ ";path=/ \r\n%s\r\n",
+ server_cookie);