int CtdlDecodeBase64(char *dest, const char *source, size_t length)
{
base64_decodestate _state;
+ int len;
base64_init_decodestate(&_state);
- return base64_decode_block(source, length, dest, &_state);
+ len = base64_decode_block(source, length, dest, &_state);
+ dest[len] = '\0';
+ return len;
}
int return_value;
StrBuf *NewLine = NewStrBuf();
Hdr->HR.DontNeedAuth = 1;
- StrBufAppendPrintf(NewLine, "GET /landing?go=%s HTTP/1.0", ChrPtr(Buf));
+ StrBufAppendPrintf(NewLine, "GET /landing?go=%s?failvisibly=1 HTTP/1.0", ChrPtr(Buf));
syslog(LOG_DEBUG, "Replacing with: %s", ChrPtr(NewLine));
return_value = ReadHttpSubject(Hdr, NewLine, Buf);
FreeStrBuf(&NewLine);
* goto next room
*/
void smart_goto(const StrBuf *next_room) {
- gotoroom(next_room);
- readloop(readnew, eUseDefault);
+ if (gotoroom(next_room) == 2)
+ readloop(readnew, eUseDefault);
+ else
+ do_404();
}
/*
long err = 0;
int room_name_supplied = 0;
int is_baseroom = 0;
+ int failvisibly;
+
+ /* on fail, should we fallback to _BASEROOM_? */
+ failvisibly = ibstr("failvisibly");
/* store ungoto information */
if (StrLength(gname) > 0) {
}
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, &err) != 2) {
+ if (failvisibly) {
+ FreeStrBuf(&Buf);
+ return err;
+ }
serv_puts("GOTO _BASEROOM_");
StrBuf_ServGetln(Buf);
/*