Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
- Do not let chatty send empty messages
- Add option to `markdown_to_raw()` to only get length of raw text
|
|
|
|
|
|
|
|
|
|
- Changed bracket style as well
|
|
Each client now has an ID that is permanently stored to ID_FILE
location. To implement this each client now uses two connections to the
server, one for bidirectional communication and one for unidirectional
communication. This makes it easier to not receive unexpected message.
Also each client and server now has a Client struct that represents a
client and a clientsArena associated with it.
Minor changes:
- Added logging to LOGFILE, that can be turned with LOGGING macro.
- Added more error types
- Added error handling on server
- Added error messages
- Added convenience functions
- Added disconnectAndNotify() function for convenience
- Use recvTextMessageResult as multiple-value-return-type instead of **
- Separated protocol stuff into protocol.h
- Added Result types when wanting to return multiple values
- Do not allocate arena's with malloc
- Added recvAnyMessageType for receiving messages that do not need to
be stored
- Add UNIFD and BIFD file descriptors for separating requests
chatty.c:
- Convert ID to string in screen_home()
- Removed the fds global variable
- Pass fds to threadReconnect
- Implement faster sleep with nanosleep(2)
- Close file descriptors when failed so we do not have too many file
descriptors open
server.c:
- Send presence messages on disconnect & connect
- renamed i to conn
|
|
Also skip offset messages.
|
|
- disconnect(): for disconnecting a client and deinitializing it
- sendToOthers(): for sending a message to all other clients
- initClient(): for initializing a client
|
|
|
|
Use a protocol defined in `README.md` and `chatty.h` for sending
messages.
Another big change is the clientsArena which now stores metadata for the
connection such as the author's name.
Misc:
- Merged arena.h and common.h into chatty.h
- removed all the unused code from arena.h as it was not very
useful and would not win me any time.
- Added compile_flag.txt
- Changed formatting
- Added more log messages
- Added more asserts
- Added bool type via enum
|
|
Use arenas where possible to have growable buffers
- Use of bufArena in server and client for receiving&sending messages
- Use of inputArena in client
Also organized code
|
|
|