* In SendData(), TCP will now split the buffer into smaller parts if it
can send data (ie. there is free space in the buffer queue left, but
not enough to send the whole buffer, and the free space is more than
the send low water mark of the socket).
* Both of these changes together let TCP now pass the "forwarding" test
of the OpenSSH suite.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25294 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Prepend "ahci port" to all trace entries in ahci_port.cpp.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25293 a95241bf-73f2-0310-859d-f6bbb57e9c96
module to the stack module. There's a dedicated struct
ancillary_data_container, now. One can just set the container on a
net_buffer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25292 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Added controller attribute to the AHCIPort class for debugging purposes.
AHCI is failing whenever the PRD table has an address above the 2048 Mb mark.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25291 a95241bf-73f2-0310-859d-f6bbb57e9c96
the socket first, so the FD open flags are in sync with that. Fixes
situations where a socket accept()ed from a non-blocking listener socket
wouldn't have O_NONBLOCK set.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25288 a95241bf-73f2-0310-859d-f6bbb57e9c96
socket. Not sure, if there are any cases where there is a next protocol,
though. Please review.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25287 a95241bf-73f2-0310-859d-f6bbb57e9c96
ignored. This fixes the hanging OpenSSH "multiplex" test. Save for the
"forwarding" test, which sometimes hangs due to a TCP bug, the complete
test suite passes, now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25284 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Trivial adjustments of code using mutexes. Mostly removing the
mutex_init() return value check.
* Added mutex_lock_threads_locked(), which is called with the threads
spinlock being held. The spinlock is released while waiting, of
course. This function is useful in cases where the existence of the
mutex object is ensured by holding the threads spinlock.
* Changed the two instances in the VFS code where an IO context of
another team needs to be locked to use mutex_lock_threads_locked().
Before it required a semaphore-based mutex implementation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25283 a95241bf-73f2-0310-859d-f6bbb57e9c96
table. This is not necessary, but allows for a better solution fo how to
lock the IO context of another team.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25281 a95241bf-73f2-0310-859d-f6bbb57e9c96
that can unlock the mutex, so one bit is sufficient.
* Added cutex_init_etc() which has an additional "flags" parameter.
The only specifyable flag is CUTEX_FLAG_CLONE_NAME, which causes the
function to strdup() the given name and free() its copy in
cutex_destroy().
* cutex_destroy() does now unblock waiting threads.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25280 a95241bf-73f2-0310-859d-f6bbb57e9c96
when using the shutdown() command.
* If TCP no longer needs a socket, it will now set the flag FLAG_DELETE_ON_CLOSE;
when the socket is closed from the upper layers, it will set the FLAG_CLOSED
flag - and only if both are set, TCP will now delete the socket itself on
receive.
* This fixes bug #2189.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25278 a95241bf-73f2-0310-859d-f6bbb57e9c96
name, couldn't resist :-P). It's semantically equivalent to a mutex,
but doesn't need a semaphore (it uses thread blocking and a simple
queue instead). Initialization can't fail. In fact it is ready to use
without initialization when living in the bss segment, also in the
early boot process. It's as fast as a benaphore in cases of low lock
contention, and faster otherwise. Only disadvantage is the higher
immediate memory footprint of 16 bytes.
* Changed how the "thread" and "threads" debugger commands list the
objects they are waiting for. Cutexes are also included.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25276 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added data_node::flags field and currently only flag
DATA_NODE_READ_ONLY, indicating that the node is read-only (i.e.
a clone). If set, the node won't have any header or tail space. Not
being able to write to it is not yet enforced, though.
* Moved data_node::tail_space to data_header.
* Removed data_node:used_header_space/own_header_space.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25275 a95241bf-73f2-0310-859d-f6bbb57e9c96
the selecting thread, which has obviously no effect.
* Changed select_info::events to vint32. It is now updated atomically.
This removes a race condition when concurrent threads would notify at
the same time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25273 a95241bf-73f2-0310-859d-f6bbb57e9c96
by BWindow, no longer by the app_server. This should stop the "screen freeze"
effect.
This adds a dependency on libpng.so and libz.so to libbe.so. The same
dependencies and the PNGDump code added here can be removed from the
app_server. I am just waiting for a code review of this before doing that.
This implementation still does not give the client a chance to handle it
differently.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25269 a95241bf-73f2-0310-859d-f6bbb57e9c96
select_fd() first added the select info to the IO context and then
called select() on the descriptor, a close() called at the same time
could already deselect the events and close the descriptor before
select_fd() was done with select(). select_fd() does now keep an own
open reference while selecting the events and add the select info
afterwards to the IO context (if the FD is still current).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25266 a95241bf-73f2-0310-859d-f6bbb57e9c96
not necessary, since the VFS makes sure (or should at least) that all
events are deselected when close() is called. ~0 isn't a valid event
anyway.
* Removed delete_select_sync_pool() in socket_free(). It's not
necessary, since the select_sync_pool is auto-destroyed when the last
event has been deselected (which the VFS should take care of).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25265 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Made the pointers const.
* Changed how the ARP module maintains its arp_entry::request_buffer: it
now uses the atomic_pointer*() functions to make sure there is no race
condition, and it's deleted only once.
* Getting an ARP entry would return uninitialized data, if the entry hadn't
been resolved yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25263 a95241bf-73f2-0310-859d-f6bbb57e9c96
responsibility never to call notify_select_event() after deselect().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25262 a95241bf-73f2-0310-859d-f6bbb57e9c96
64-bit safe version of atomic_test_and_set() for pointers:
atomic_pointer_test_and_set().
* The VFS is now using this function (it's not used anywhere else in the
kernel this way).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25260 a95241bf-73f2-0310-859d-f6bbb57e9c96
although it put the freed space in the free list. Alternating
invocations of alloc_...() and free_...() would thus increase the
header space unboundedly.
* Unified the way a data_header and data_node access the header space.
Originally data_header::data_space and data_node::header_space had to
be kept in sync, which some functions failed to do. Introduced a
header_space structure, which is located in data_header and referenced
by data_node, so that accessing it either way does always keep both
structures in sync.
* Removed the special handling for the data node created with a buffer.
Since remove_{header,trailer}() and trim() could remove it without
knowing, the last reference to the first data header would be freed
prematurely, causing operations on freed memory, and in the end a
second free which screwed the object cache's free list. This crashed
Haiku e.g. when running OpenSSH's "forwarding" test. Now the first
created node is just a node like any other. It's allocated in the data
header, too.
* Changed the mechanism how data nodes are allocated. Now they will
always be allocated on a header associated with the buffer for which
they are created. This fixes a race condition when freeing them. They
would otherwise modify the free list of a header which might be
accessed by another thread at the same time (added a TODO explaining
how the old code could possibly be fixed). Also squashed several
TODOs related to running out of header space when allocating a node.
If the buffer runs out of header space, it will simply allocate a new
header, now.
* Dealt with some TODOs regarding reverting the buffer to its previous
state when running out of memory after allocating a few nodes.
* Added several TODOs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25256 a95241bf-73f2-0310-859d-f6bbb57e9c96
This fixes bug #1900 for real.
* Rearranged find_page_candidate() a bit, removed duplicate code, added a panic
in case the marker state is invalid.
* Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25255 a95241bf-73f2-0310-859d-f6bbb57e9c96
arp_update_entry(). While arp_timer() was sending the last request
arp_update_entry() could be called (caused by an incoming reply) and
free the request buffer, which arp_timer() would free a moment later
again. The problem is not completely solved, since a duplicate reply can
still cause a double free. Checked in mainly for Axel's reading
pleasure. :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25252 a95241bf-73f2-0310-859d-f6bbb57e9c96
sPageLock. This could easily mess up the page queue.
* Now, remove_page_marker() gets the lock itself. This fixes bug #1900.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25250 a95241bf-73f2-0310-859d-f6bbb57e9c96
block would be incorrectly addressed when allocating a stream - this could
cause random blocks to be overwritten, and therefore could cause many sorts
of problems.
* Moved BFS_TRACING macro to the tracing_config.h file, and let it follow the
new semantics of those other macros in there.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25249 a95241bf-73f2-0310-859d-f6bbb57e9c96
if the other end is not a Haiku host (retrieving of urgent data is still
missing).
* Resolved TODO: SendData() now sends a SIGPIPE when trying to send on a
closed connection.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25245 a95241bf-73f2-0310-859d-f6bbb57e9c96