Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
Python-3.10.14 /
Objects /
stringlib /
Delete
Unzip
Name
Size
Permission
Date
Action
clinic
[ DIR ]
drwxr-xr-x
2024-03-19 22:46
README.txt
1.16
KB
-rw-r--r--
2024-03-19 22:46
asciilib.h
1.11
KB
-rw-r--r--
2024-03-19 22:46
codecs.h
27.39
KB
-rw-r--r--
2024-03-19 22:46
count.h
666
B
-rw-r--r--
2024-03-19 22:46
ctype.h
3.04
KB
-rw-r--r--
2024-03-19 22:46
eq.h
848
B
-rw-r--r--
2024-03-19 22:46
fastsearch.h
24.3
KB
-rw-r--r--
2024-03-19 22:46
find.h
3.19
KB
-rw-r--r--
2024-03-19 22:46
find_max_char.h
3.64
KB
-rw-r--r--
2024-03-19 22:46
join.h
4.62
KB
-rw-r--r--
2024-03-19 22:46
localeutil.h
2.5
KB
-rw-r--r--
2024-03-19 22:46
partition.h
3.22
KB
-rw-r--r--
2024-03-19 22:46
replace.h
1.81
KB
-rw-r--r--
2024-03-19 22:46
split.h
11.05
KB
-rw-r--r--
2024-03-19 22:46
stringdefs.h
1.13
KB
-rw-r--r--
2024-03-19 22:46
stringlib_find_two_way_notes.txt
16.37
KB
-rw-r--r--
2024-03-19 22:46
transmogrify.h
19.4
KB
-rw-r--r--
2024-03-19 22:46
ucs1lib.h
1.08
KB
-rw-r--r--
2024-03-19 22:46
ucs2lib.h
1.08
KB
-rw-r--r--
2024-03-19 22:46
ucs4lib.h
1.09
KB
-rw-r--r--
2024-03-19 22:46
undef.h
212
B
-rw-r--r--
2024-03-19 22:46
unicode_format.h
40.36
KB
-rw-r--r--
2024-03-19 22:46
unicodedefs.h
1.19
KB
-rw-r--r--
2024-03-19 22:46
Save
Rename
/* stringlib: bytes joining implementation */ #if STRINGLIB_IS_UNICODE #error join.h only compatible with byte-wise strings #endif Py_LOCAL_INLINE(PyObject *) STRINGLIB(bytes_join)(PyObject *sep, PyObject *iterable) { const char *sepstr = STRINGLIB_STR(sep); Py_ssize_t seplen = STRINGLIB_LEN(sep); PyObject *res = NULL; char *p; Py_ssize_t seqlen = 0; Py_ssize_t sz = 0; Py_ssize_t i, nbufs; PyObject *seq, *item; Py_buffer *buffers = NULL; #define NB_STATIC_BUFFERS 10 Py_buffer static_buffers[NB_STATIC_BUFFERS]; #define GIL_THRESHOLD 1048576 int drop_gil = 1; PyThreadState *save = NULL; seq = PySequence_Fast(iterable, "can only join an iterable"); if (seq == NULL) { return NULL; } seqlen = PySequence_Fast_GET_SIZE(seq); if (seqlen == 0) { Py_DECREF(seq); return STRINGLIB_NEW(NULL, 0); } #ifndef STRINGLIB_MUTABLE if (seqlen == 1) { item = PySequence_Fast_GET_ITEM(seq, 0); if (STRINGLIB_CHECK_EXACT(item)) { Py_INCREF(item); Py_DECREF(seq); return item; } } #endif if (seqlen > NB_STATIC_BUFFERS) { buffers = PyMem_NEW(Py_buffer, seqlen); if (buffers == NULL) { Py_DECREF(seq); PyErr_NoMemory(); return NULL; } } else { buffers = static_buffers; } /* Here is the general case. Do a pre-pass to figure out the total * amount of space we'll need (sz), and see whether all arguments are * bytes-like. */ for (i = 0, nbufs = 0; i < seqlen; i++) { Py_ssize_t itemlen; item = PySequence_Fast_GET_ITEM(seq, i); if (PyBytes_CheckExact(item)) { /* Fast path. */ Py_INCREF(item); buffers[i].obj = item; buffers[i].buf = PyBytes_AS_STRING(item); buffers[i].len = PyBytes_GET_SIZE(item); } else { if (PyObject_GetBuffer(item, &buffers[i], PyBUF_SIMPLE) != 0) { PyErr_Format(PyExc_TypeError, "sequence item %zd: expected a bytes-like object, " "%.80s found", i, Py_TYPE(item)->tp_name); goto error; } /* If the backing objects are mutable, then dropping the GIL * opens up race conditions where another thread tries to modify * the object which we hold a buffer on it. Such code has data * races anyway, but this is a conservative approach that avoids * changing the behaviour of that data race. */ drop_gil = 0; } nbufs = i + 1; /* for error cleanup */ itemlen = buffers[i].len; if (itemlen > PY_SSIZE_T_MAX - sz) { PyErr_SetString(PyExc_OverflowError, "join() result is too long"); goto error; } sz += itemlen; if (i != 0) { if (seplen > PY_SSIZE_T_MAX - sz) { PyErr_SetString(PyExc_OverflowError, "join() result is too long"); goto error; } sz += seplen; } if (seqlen != PySequence_Fast_GET_SIZE(seq)) { PyErr_SetString(PyExc_RuntimeError, "sequence changed size during iteration"); goto error; } } /* Allocate result space. */ res = STRINGLIB_NEW(NULL, sz); if (res == NULL) goto error; /* Catenate everything. */ p = STRINGLIB_STR(res); if (sz < GIL_THRESHOLD) { drop_gil = 0; /* Benefits are likely outweighed by the overheads */ } if (drop_gil) { save = PyEval_SaveThread(); } if (!seplen) { /* fast path */ for (i = 0; i < nbufs; i++) { Py_ssize_t n = buffers[i].len; char *q = buffers[i].buf; memcpy(p, q, n); p += n; } } else { for (i = 0; i < nbufs; i++) { Py_ssize_t n; char *q; if (i) { memcpy(p, sepstr, seplen); p += seplen; } n = buffers[i].len; q = buffers[i].buf; memcpy(p, q, n); p += n; } } if (drop_gil) { PyEval_RestoreThread(save); } goto done; error: res = NULL; done: Py_DECREF(seq); for (i = 0; i < nbufs; i++) PyBuffer_Release(&buffers[i]); if (buffers != static_buffers) PyMem_Free(buffers); return res; } #undef NB_STATIC_BUFFERS #undef GIL_THRESHOLD