}
+// Succeed with no output
+void do_204(struct http_transaction *h) {
+ h->response_code = 204;
+ h->response_string = strdup("No content");
+}
+
+
// We throw an HTTP error "502 bad gateway" when we need to connect to Citadel, but can't.
void do_502(struct http_transaction *h) {
h->response_code = 502;
// Client is setting the "Last Read Pointer" (marking all messages as "seen" up to this message)
void set_last_read_pointer(struct http_transaction *h, struct ctdlsession *c) {
- syslog(LOG_DEBUG, "FIXME: set last read pointer");
- do_404(h); // FIXME do this
+ char cbuf[1024];
+ ctdl_printf(c, "SLRP %d", atoi(get_url_param(h, "last")));
+ ctdl_readline(c, cbuf, sizeof(cbuf));
+ if (cbuf[0] == '2') {
+ do_204(h);
+ }
+ else {
+ do_404(h);
+ }
}
</span>
<span class="w3-right">
<button id="ctdl-newmsg-button" style="display:none" class="w3-bar-item w3-button" onclick="entmsg_dispatcher();">enter</button>
- <button id="ctdl-skip-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(0);">ungoto</button>
+ <button id="ctdl-ungoto-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(0);">ungoto</button>
<button id="ctdl-skip-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(1);">skip</button>
<button id="ctdl-goto-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(2);">goto</button>
<span id="lilo" class="w3-bar-item">Login</span>
// Goto next room with unread messages
// which_oper is 0=ungoto, 1=skip, 2=goto
function gotonext(which_oper) {
-
if (which_oper == 2) { // Goto needs to mark messages as seen
- console.log("FIXME set lrp to " + last_seen);
+
set_last_read_pointer = async() => {
response = await fetch("/ctdl/r/" + escapeHTMLURI(current_room) + "/slrp?last=" + last_seen);
}
march_list.push({name:"_BASEROOM_",known:true,hasnewmsgs:true,floor:0});
}
- console.log(march_list);
gotonext(which_oper);
}
}
#define CLIENT_ID 4
#define TARGET "webcit02" /* Window target for inline URL's */
-void worker_entry(int *pointer_to_master_socket);
+void worker_entry(int *);
void perform_one_http_transaction(struct client_handle *ch);
void add_response_header(struct http_transaction *h, char *key, char *val);
void perform_request(struct http_transaction *);
+void do_204(struct http_transaction *);
void do_404(struct http_transaction *);
+void do_412(struct http_transaction *);
+void do_502(struct http_transaction *);
void output_static(struct http_transaction *);
-int uds_connectsock(char *sockpath);
+int uds_connectsock(char *);
void ctdl_a(struct http_transaction *, struct ctdlsession *);
void ctdl_f(struct http_transaction *, struct ctdlsession *);
void ctdl_r(struct http_transaction *, struct ctdlsession *);
int webserver(char *webserver_interface, int webserver_port, int webserver_protocol);
void ctdl_printf(struct ctdlsession *ctdl, const char *format,...);
int webcit_tcp_server(const char *ip_addr, int port_number, int queue_len);
-void do_502(struct http_transaction *h);
-void do_404(struct http_transaction *h);
-void do_412(struct http_transaction *h);
void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf);
void json_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum);