Let $C$ be a complex algebraic curve. It is well known that if $L$ is a special divisor on $C$, i.e., $h^0(L) > 0$ and $h^1(L) > 0$, then $$ h^0 (L) \le \frac{1}{2} \deg L + 1. $$ Assume that $L$ is not trivial and $L \ne K_C$. The equality holds if and only if $C$ is hyperelliptic.
My question is that: if there is a nontrivial special divisor $L$ on $C$ such that $L \ne K_C$ $$ h^0 (L) = \frac{1}{2} \deg L $$ holds, then what conditions $C$ should satisfy? For example, $C$ could be hyperelliptic. Is there a complete classification?

